import request from '@/utils/request'
// 新增工单触发器
export function addSave(params) {
  return request({
    url: window.CONFIG.workOrderRestIp + '/workOrderTriggerInfo/addSave',
    method: 'post',
    data: params
  })
}
// 编辑触发器
export function upadteById(params) {
  return request({
    url: window.CONFIG.workOrderRestIp + '/workOrderTriggerInfo/upadteById',
    method: 'post',
    data: params
  })
}
// 批量删除工单触发器
export function batchDelete(params) {
  return request({
    url: window.CONFIG.workOrderRestIp + '/workOrderTriggerInfo/batchDelete',
    method: 'post',
    data: params
  })
}
// 批量修改工单触发器状态
export function batchUpdateStatus(params) {
  return request({
    url: window.CONFIG.workOrderRestIp + '/workOrderTriggerInfo/batchUpdateStatus',
    method: 'post',
    data: params
  })
}
// 获取工单触发器详情
export function getDetailById(id) {
  return request({
    url: window.CONFIG.workOrderRestIp + '/workOrderTriggerInfo/getDetailById?id=' + id,
    method: 'get'
  })
}
// 获取工单触发器列表
export function getTriggerList(params) {
  return request({
    url: window.CONFIG.workOrderRestIp + '/workOrderTriggerInfo/getTriggerList',
    method: 'post',
    data: params
  })
}
// 执行动作中获取一级数据
export function getTriggerActionTypeFirstList(id) {
  return request({
    url: window.CONFIG.workOrderRestIp + '/workOrderTriggerInfo/getTriggerActionTypeFirstLists?triggerTypeCode=' + id,
    method: 'get'
  })
}
// 根据工单流程id获取该类型下的所有模板字段信息
export function getWorkTypeAllFiledInfoByWorkOrderTypeId(id) {
  return request({
    url: window.CONFIG.workOrderRestIp + '/workOrderTriggerInfo/getWorkTypeAllFiledInfoByWorkOrderTypeId?workOrderTypeId=' + id,
    method: 'get'
  })
}

export function getTriggerActionTypeSecondList(id) {
  return request({
    url: window.CONFIG.workOrderRestIp + '/workOrderTriggerInfo/getTriggerActionTypeSecondList/' + id,
    method: 'get'
  })
}
